import React from 'react'
import {
    Routes,
    Route,
    NavLink,
    Navigate,
} from 'react-router-dom'

import Home from './pages/Home'
import Details from './pages/Details'

import './App.css'

export default function App() {
    return (
        <div id='container'>
            <nav>
                <NavLink to={'/home'}>首页</NavLink>
                <NavLink to={'/details'}>用户详情</NavLink>
            </nav>

            <Routes>
                <Route path={"/"} element={<Navigate to={'/home'} />}></Route>
                <Route path={"/home"} element={<Home/>}></Route>
                <Route path={"/details/:id.html"} element={<Details/>}></Route>
            </Routes>
        </div>


    )
}
